#pragma once

#include <gofcl_rcu_apb1.h>
#include <gofcl_rcu_r.h>

static inline void rcu_wreg_apb1en_s(rcu_apb1_s apb1) {
	union {
		rcu_apb1_s a;
		u32_s u;
	} au = {
		.a = apb1,
	};
	rcu_wreg(RCU_APB1EN_R, au.u);
}

static inline void rcu_wreg_apb1en_0_15_s(rcu_apb1_0_15_s apb1_0_15) {
	union {
		rcu_apb1_0_15_s a;
		u32_s u;
	} au = {
		.a = apb1_0_15,
	};
	rcu_wreg_u16(RCU_APB1EN_R, T16B_0_R, au.u);
}

static inline void rcu_wreg_apb1en_16_31_s(rcu_apb1_16_31_s apb1_16_31) {
	union {
		rcu_apb1_16_31_s a;
		u32_s u;
	} au = {
		.a = apb1_16_31,
	};
	rcu_wreg_u16(RCU_APB1EN_R, T16B_2_R, au.u);
}

static inline void rcu_wreg_apb1en_0_7_s(rcu_apb1_0_7_s apb1_0_7) {
	union {
		rcu_apb1_0_7_s a;
		u32_s u;
	} au = {
		.a = apb1_0_7,
	};
	rcu_wreg_u8(RCU_APB1EN_R, T8B_0_R, au.u);
}

static inline void rcu_wreg_apb1en_8_15_s(rcu_apb1_8_15_s apb1_8_15) {
	union {
		rcu_apb1_8_15_s a;
		u32_s u;
	} au = {
		.a = apb1_8_15,
	};
	rcu_wreg_u8(RCU_APB1EN_R, T8B_1_R, au.u);
}

static inline void rcu_wreg_apb1en_16_23_s(rcu_apb1_16_23_s apb1_16_23) {
	union {
		rcu_apb1_16_23_s a;
		u32_s u;
	} au = {
		.a = apb1_16_23,
	};
	rcu_wreg_u8(RCU_APB1EN_R, T8B_2_R, au.u);
}

static inline void rcu_wreg_apb1en_24_31_s(rcu_apb1_24_31_s apb1_24_31) {
	union {
		rcu_apb1_24_31_s a;
		u32_s u;
	} au = {
		.a = apb1_24_31,
	};
	rcu_wreg_u8(RCU_APB1EN_R, T8B_3_R, au.u);
}
